<?php

class InputFile extends FormElement {

	/**
	 * Constructor for the InputFile class, passes variables to the FormElement constructor.
	 *
	 * @param String $name
	 */
	public function __construct( $name, $label = '' )
	{
		parent::__construct( $name, array( 'label' => $label ) );
	}

	/**
	 * @see FormElement::__toString()
	 */
	public function __toString() {
		return '<div class="form fileuploadform"><label for="' . ( $this->getFormName() != '' ? $this->getFormName() . '_' : '' ) . $this->name . '">' . $this->getProperty("label") . '</label><input type="file" name="' . ( $this->getFormName() != '' ? $this->getFormName() . '_' : '' ) . $this->name . '" id="' . ( $this->getFormName() != '' ? $this->getFormName() . '_' : '' ) . $this->name . '"/>' . ( $this->inAJAXMode() || !empty( $this->errorMessage ) ? '<div class="error' . ( $this->inAJAXMode() ? ' ajax' : '' ) . '" id="' . ( $this->getFormName() != '' ? $this->getFormName() . '_' : '' ) . $this->name . '_error">' . $this->errorMessage . '</div>' : '' ) . '</div>';
	}

}

?>